#!/usr/bin/env python
# encoding: utf-8
# @author: qiaowei
# @license: (C) Copyright 2013-2019
# @contact: weiweiqiao@126.com
# @file: worker.py
# @time: 2020/7/28 0028
# @desc:


import threading
from random import randint
from PySide2.QtCore import QThread
from PySide2.QtCore import Slot
from PySide2.QtCore import Signal
from PySide2.QtCore import QObject


class Worker(QObject):
    def __init__(self):
        super().__init__()
        # QObject().__init__()
        print('Worker thread = ' + str(self.thread()))
        self.signal_receiver.connect(self.do_something)

    @Slot(str)
    def do_something(self, content: str):
        print('Worker.do_something = ' + str(self.thread()))

    @Slot()
    def print_thread_id(self):
        print('Worker.do_something = ' + str(self.thread()))

    signal_receiver = Signal(str)
